<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>首页</title>
</head>
<body>
<%
    String username = (String)session.getAttribute("username");
    String time = (String)session.getAttribute("time");
    String path = application.getContextPath();
    if(username!=null){
%>
    <h5>欢迎用户:<%=username%>
    <%=time==null?"首次登录":"您的上次登录时间为"+time%>
    </h5>
    <a href="<%=path%>/addStudent.jsp">添加</a>
    <a href="<%=path%>/listStudentServlet">查看</a>
    <a href="<%=path%>/exportServlet">导出</a>
    <a href="<%=path%>/logoutServlet">注销</a>

    <%}else response.sendRedirect(application.getContextPath()+"/login.jsp");
    %>
</body>
</html>
